package com.epoch.servicetest.service.impl;

import com.epoch.servicetest.dao.ExamDao;
import com.epoch.servicetest.service.ExamService;
import com.epoch.servicetest.test.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * @author mi
 */
@Service
@Slf4j
public class ExamServiceImpl implements ExamService {
    @Resource
    private ExamDao examDao;

    @Override
    public List<Object> getExamInfo() {
        List<Exam> examList = examDao.getExamInfo();
        List<Object> resultList = new ArrayList<>();
        for(Exam list:examList){
            System.out.println(list);
            HashMap<String,Object> examMap = new HashMap(8);
            examMap.put("examName",list.getExamName());
            examMap.put("examInfo",list.getExamInfo());
            examMap.put("examPhoto",list.getExamPhoto());
            examMap.put("examTestId",list.getExamTestId());
            resultList.add(examMap);
        }
        return resultList;
    }



}
